void setup(){
  pinMode(5, OUTPUT);
}

void loop(){
  if (analogRead(A2) < 512) {
    digitalWrite(5,HIGH);
  }
  if (analogRead(A2) >= 512) {
    digitalWrite(5,LOW);
  }
}
